//
//  SimilarResult.swift
//  ShopIOS
//
//  Created by Apple on 2019/8/12.
//  Copyright © 2019 Apple. All rights reserved.
//

import Foundation
import SwiftyJSON
struct SimilarResult {
    var Product = [SimilarProduct]()
    init(json: JSON) {
        Product = json.arrayValue.compactMap({ SimilarProduct(json: $0)})
    }
}

struct SimilarProduct {
    var bottomId: Int = 0
    var isRebate: Bool = false
    var freightTemplateId: Int = 0
    var imagePath: String?
    var topId: Int = 0
    var categoryId: Int = 0
    var isInstall: Bool = false
    var productCode: String?
    var displaySequence: Int = 0
    var isCategory: Int = 0
    var shortDescription: String?
    var maxBuyCount: Int = 0
    var shopId: Int = 0
    var saleStatus: Int = 0
    var brandId: Int = 0
    var marketPrice: Int = 0
    var productName: String?
    var vistiCounts: Int = 0
    var editStatus: Int = 0
    var showProductState: String?
    var auditStatus: Int = 0
    var measureUnit: String?
    var categoryTopId: Int = 0
    var categoryPath: String?
    var minSalePrice: Int = 0
    var volume: Int = 0
    var weight: Int = 0
    var addedDate: String?
    var rebateRate: Int = 0
    var saleCounts: Int = 0
    var typeId: Int = 0
    var hasSKU: Bool = false
    var relativePath: String?
    var orderCounts: Int = 0
    var concernedCount: Int = 0
    var id: Int = 0
    
    init(json: JSON) {
        bottomId = json["bottomId"].intValue
        isRebate = json["isRebate"].boolValue
        freightTemplateId = json["freightTemplateId"].intValue
        imagePath = json["imagePath"].stringValue
        topId = json["topId"].intValue
        categoryId = json["categoryId"].intValue
        isInstall = json["isInstall"].boolValue
        productCode = json["productCode"].stringValue
        displaySequence = json["displaySequence"].intValue
        isCategory = json["isCategory"].intValue
        shortDescription = json["shortDescription"].stringValue
        maxBuyCount = json["maxBuyCount"].intValue
        shopId = json["shopId"].intValue
        saleStatus = json["saleStatus"].intValue
        brandId = json["brandId"].intValue
        marketPrice = json["marketPrice"].intValue
        productName = json["productName"].stringValue
        vistiCounts = json["vistiCounts"].intValue
        editStatus = json["editStatus"].intValue
        showProductState = json["showProductState"].stringValue
        auditStatus = json["auditStatus"].intValue
        measureUnit = json["measureUnit"].stringValue
        categoryTopId = json["categoryTopId"].intValue
        categoryPath = json["categoryPath"].stringValue
        minSalePrice = json["minSalePrice"].intValue
        volume = json["volume"].intValue
        weight = json["weight"].intValue
        addedDate = json["addedDate"].stringValue
        rebateRate = json["rebateRate"].intValue
        saleCounts = json["saleCounts"].intValue
        typeId = json["typeId"].intValue
        hasSKU = json["hasSKU"].boolValue
        relativePath = json["relativePath"].stringValue
        orderCounts = json["orderCounts"].intValue
        concernedCount = json["concernedCount"].intValue
        id = json["id"].intValue
    }
    
}
